Skip to content

Add reference element reads - #153

Merged
CryZe merged 1 commit into
LiveSplit:masterfrom
ero-qt:reference-collections
Sep 18, 2026
Merged

CryZe merged 1 commit into
LiveSplit:masterfrom
ero-qt:reference-collections

Conversation

@ero-qt

@ero-qt ero-qt commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Part of #149.

Adds read_reference_array and read_reference_list, which hand back the elements' object addresses, and read_string_object, which reads a string at one of those addresses. read_string is a dereference followed by read_string_object. string[] and List<string> become readable.

Reference elements are pointers at the target's width, so a width claim through read_array compiles at either width and silently answers garbage at the wrong one. These readers own the width. Null elements come back as null addresses at their positions, and only a null collection reference refuses.

Custom-class elements work the same way. The object address plus get_field_offset reads fields directly.

cargo test --all-features runs the suite. The new tests cover reference arrays and lists on both runtimes, lengths past the buffer, nulls kept in place, and string objects at their addresses.

@ero-qt
ero-qt force-pushed the reference-collections branch 14 times, most recently from e0c22dd to a6eff49 Compare September 17, 2026 20:52
@ero-qt
ero-qt force-pushed the reference-collections branch from a6eff49 to a263be6 Compare September 18, 2026 02:49

@CryZe CryZe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the public API and implementation, ran the full local test suite, and verified read_reference_list, read_reference_array, and read_string_object against a live Lunistice IL2CPP process. All three passed.

@CryZe
CryZe merged commit 4d98f0d into LiveSplit:master Sep 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants